package com.bqtv.sport.commen.utils

import android.content.Context
import android.graphics.drawable.Drawable
import android.graphics.drawable.GradientDrawable
import com.hjq.toast.style.BlackToastStyle
import me.jessyan.autosize.utils.AutoSizeUtils

/**
 *    desc   : Toast 样式配置
 */
class ToastStyle : BlackToastStyle() {

    override fun getBackgroundDrawable(context: Context): Drawable {
        val drawable = GradientDrawable()
        // 设置颜色
        drawable.setColor(-0x78000000)
        // 设置圆角
        drawable.cornerRadius = AutoSizeUtils.dp2px(context,999f).toFloat()
        return drawable
    }

    override fun getTextSize(context: Context): Float {
        return AutoSizeUtils.sp2px(context,14f).toFloat()
    }

    override fun getHorizontalPadding(context: Context): Int {
        return AutoSizeUtils.sp2px(context,24f)
    }

    override fun getVerticalPadding(context: Context): Int {
        return AutoSizeUtils.sp2px(context,16f)
    }
}